﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace altus.Controllers
{
	public class HomeController : Controller
	{
		Dictionary<string,List<string>> _menu;
		
		public HomeController()
		{
			_menu = BuildMenu();
		}

		public ActionResult Index()
		{
			ViewBag.Master = "首页";
			ViewBag.MainMenu = BuildMenu().Keys.ToList();

			return View();
		}

		#region 新闻中心
		public ActionResult News()
		{
			ViewBag.Master = "新闻中心";
			ViewBag.MainPageTitle = ViewBag.Master;
			ViewBag.LeftMenu = _menu[ViewBag.Master];
			ViewBag.MainMenu = BuildMenu().Keys.ToList();
			return View();
		}
		#endregion

		#region 产品选购
		public ActionResult Product()
		{
			ViewBag.Master = "产品选购";
			ViewBag.Sub = "热销产品";
			ViewBag.MainPageTitle = ViewBag.Sub;
			ViewBag.DelRight = true;
			ViewBag.LeftMenu = _menu[ViewBag.Master];
			ViewBag.MainMenu = BuildMenu().Keys.ToList();
			return View();
		}
		#endregion

		#region 客户服务
		public ActionResult KF()
		{
			ViewBag.Master = "客户服务";
			ViewBag.Sub = "Altus客服";
			ViewBag.MainPageTitle = ViewBag.Sub;
			ViewBag.LeftMenu = _menu[ViewBag.Master];
			ViewBag.MainMenu = BuildMenu().Keys.ToList();
			return View();
		}

		public ActionResult KF2()
		{
			ViewBag.Master = "客户服务";
			ViewBag.Sub = "咨询·留言";
			ViewBag.MainPageTitle = ViewBag.Sub;
			ViewBag.LeftMenu = _menu[ViewBag.Master];
			ViewBag.MainMenu = BuildMenu().Keys.ToList();
			return View();
		}
		#endregion

		#region 关于ALTUS
		public ActionResult AboutSJZ()
		{
			ViewBag.Master = "关于ALTUS";
			ViewBag.Sub = "ALTUS时间轴";
			ViewBag.MainPageTitle = ViewBag.Sub;
			ViewBag.LeftMenu = _menu[ViewBag.Master];
			ViewBag.MainMenu = BuildMenu().Keys.ToList();
			return View();
		}
		#endregion

		#region 营销互动
		public ActionResult YXHD1()
		{
			ViewBag.Master = "营销互动";
			ViewBag.MainPageTitle = ViewBag.Master;
			ViewBag.LeftMenu = _menu[ViewBag.Master];
			ViewBag.MainMenu = BuildMenu().Keys.ToList();
			return View();
		}
		public ActionResult YXHD2()
		{
			ViewBag.Master = "营销互动";
			ViewBag.MainPageTitle = ViewBag.Master;
			ViewBag.LeftMenu = _menu[ViewBag.Master];
			ViewBag.MainMenu = BuildMenu().Keys.ToList();
			return View();
		}
		#endregion

		private Dictionary<string,List<string>> BuildMenu()
		{
			var menu = new Dictionary<string, List<string>>();
			menu.Add("首页",null);
			menu.Add("关于ALTUS", new List<string> { "品牌愿景","ALTUS全球" ,"ALTUS与中国","ALTUS时间轴"});
			menu.Add("产品选购",new List<string>{"热销产品","洗衣机、干衣机","冰箱"});
			menu.Add("新闻中心", new List<string>{"品牌动向","媒体聚焦","媒体报道","官方发言","互动空间"});
			menu.Add("客户服务", new List<string>{"Altus客服","咨询·留言"});
			menu.Add("营销互动", new List<string>{"营销互动"});
			return menu;
		}
	}
}
